using System.Web.UI;
using System.Web.UI.HtmlControls;

namespace FluentTags
{

    public class H5Tag : Tag<H5Tag>
    {
        public H5Tag() : base("h5"){}
        
        public H5Tag(string text) : this()
        {
            Controls.Add(new LiteralControl(text));
        }

        public H5Tag(object value) : this()
        {
            Controls.Add(new LiteralControl(SafeString(value)));
        }
        
        
        public H5Tag(Control control) : this()
        {
            Controls.Add(control);
        }
        
        
        
        
        public ATag<H5Tag> A()
        {
            var ctrl = new ATag<H5Tag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public H5Tag A(ATag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public ATag<H5Tag> A(string text)
        {
            var ctrl = new ATag<H5Tag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public ATag<H5Tag> A(Control control)
        {
            var ctrl = new ATag<H5Tag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public ATag<H5Tag> A(object value)
        {
            return A(SafeString(value));
        }
        
        public BTag<H5Tag> B()
        {
            var ctrl = new BTag<H5Tag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public H5Tag B(BTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public BTag<H5Tag> B(string text)
        {
            var ctrl = new BTag<H5Tag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public BTag<H5Tag> B(Control control)
        {
            var ctrl = new BTag<H5Tag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public BTag<H5Tag> B(object value)
        {
            return B(SafeString(value));
        }
        
        public BRTag<H5Tag> BR()
        {
            var ctrl = new BRTag<H5Tag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public H5Tag BR(BRTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public EMTag<H5Tag> EM()
        {
            var ctrl = new EMTag<H5Tag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public H5Tag EM(EMTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public EMTag<H5Tag> EM(string text)
        {
            var ctrl = new EMTag<H5Tag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public EMTag<H5Tag> EM(Control control)
        {
            var ctrl = new EMTag<H5Tag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public EMTag<H5Tag> EM(object value)
        {
            return EM(SafeString(value));
        }
        
        public ITag<H5Tag> I()
        {
            var ctrl = new ITag<H5Tag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public H5Tag I(ITag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public ITag<H5Tag> I(string text)
        {
            var ctrl = new ITag<H5Tag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public ITag<H5Tag> I(Control control)
        {
            var ctrl = new ITag<H5Tag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public ITag<H5Tag> I(object value)
        {
            return I(SafeString(value));
        }
        
        public ImgTag<H5Tag> Img()
        {
            var ctrl = new ImgTag<H5Tag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public H5Tag Img(ImgTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SpanTag<H5Tag> Span()
        {
            var ctrl = new SpanTag<H5Tag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public H5Tag Span(SpanTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SpanTag<H5Tag> Span(string text)
        {
            var ctrl = new SpanTag<H5Tag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public SpanTag<H5Tag> Span(Control control)
        {
            var ctrl = new SpanTag<H5Tag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public SpanTag<H5Tag> Span(object value)
        {
            return Span(SafeString(value));
        }
        
        public StrongTag<H5Tag> Strong()
        {
            var ctrl = new StrongTag<H5Tag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public H5Tag Strong(StrongTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public StrongTag<H5Tag> Strong(string text)
        {
            var ctrl = new StrongTag<H5Tag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public StrongTag<H5Tag> Strong(Control control)
        {
            var ctrl = new StrongTag<H5Tag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public StrongTag<H5Tag> Strong(object value)
        {
            return Strong(SafeString(value));
        }
        
        public SubTag<H5Tag> Sub()
        {
            var ctrl = new SubTag<H5Tag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public H5Tag Sub(SubTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SubTag<H5Tag> Sub(string text)
        {
            var ctrl = new SubTag<H5Tag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public SubTag<H5Tag> Sub(Control control)
        {
            var ctrl = new SubTag<H5Tag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public SubTag<H5Tag> Sub(object value)
        {
            return Sub(SafeString(value));
        }
        
        public SupTag<H5Tag> Sup()
        {
            var ctrl = new SupTag<H5Tag>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public H5Tag Sup(SupTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SupTag<H5Tag> Sup(string text)
        {
            var ctrl = new SupTag<H5Tag>(this);
            Controls.Add(ctrl);
            LiteralControl lc = new LiteralControl(text);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public SupTag<H5Tag> Sup(Control control)
        {
            var ctrl = new SupTag<H5Tag>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public SupTag<H5Tag> Sup(object value)
        {
            return Sup(SafeString(value));
        }
        
        
        public H5Tag Text(string text)
        {
            Controls.Add(new LiteralControl(text));
            return this;
        }

        public H5Tag Text(object value)
        {
            Controls.Add(new LiteralControl(SafeString(value)));
            return this;
        }
        
    }

    public class H5Tag<ParentType> : ChildTag<H5Tag<ParentType>, ParentType>
        where ParentType : HtmlGenericControl
    {
        public H5Tag(ParentType parent) : base("h5", parent) { }

        
        
        
        public ATag<H5Tag<ParentType>> A()
        {
            var ctrl = new ATag<H5Tag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public H5Tag<ParentType> A(ATag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public ATag<H5Tag<ParentType>> A(string text)
        {
            var ctrl = new ATag<H5Tag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public ATag<H5Tag<ParentType>> A(Control control)
        {
            var ctrl = new ATag<H5Tag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public ATag<H5Tag<ParentType>> A(object value)
        {
            var ctrl = new ATag<H5Tag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public BTag<H5Tag<ParentType>> B()
        {
            var ctrl = new BTag<H5Tag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public H5Tag<ParentType> B(BTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public BTag<H5Tag<ParentType>> B(string text)
        {
            var ctrl = new BTag<H5Tag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public BTag<H5Tag<ParentType>> B(Control control)
        {
            var ctrl = new BTag<H5Tag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public BTag<H5Tag<ParentType>> B(object value)
        {
            var ctrl = new BTag<H5Tag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public BRTag<H5Tag<ParentType>> BR()
        {
            var ctrl = new BRTag<H5Tag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public H5Tag<ParentType> BR(BRTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public EMTag<H5Tag<ParentType>> EM()
        {
            var ctrl = new EMTag<H5Tag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public H5Tag<ParentType> EM(EMTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public EMTag<H5Tag<ParentType>> EM(string text)
        {
            var ctrl = new EMTag<H5Tag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public EMTag<H5Tag<ParentType>> EM(Control control)
        {
            var ctrl = new EMTag<H5Tag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public EMTag<H5Tag<ParentType>> EM(object value)
        {
            var ctrl = new EMTag<H5Tag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public ITag<H5Tag<ParentType>> I()
        {
            var ctrl = new ITag<H5Tag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public H5Tag<ParentType> I(ITag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public ITag<H5Tag<ParentType>> I(string text)
        {
            var ctrl = new ITag<H5Tag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public ITag<H5Tag<ParentType>> I(Control control)
        {
            var ctrl = new ITag<H5Tag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public ITag<H5Tag<ParentType>> I(object value)
        {
            var ctrl = new ITag<H5Tag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public ImgTag<H5Tag<ParentType>> Img()
        {
            var ctrl = new ImgTag<H5Tag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public H5Tag<ParentType> Img(ImgTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SpanTag<H5Tag<ParentType>> Span()
        {
            var ctrl = new SpanTag<H5Tag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public H5Tag<ParentType> Span(SpanTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SpanTag<H5Tag<ParentType>> Span(string text)
        {
            var ctrl = new SpanTag<H5Tag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public SpanTag<H5Tag<ParentType>> Span(Control control)
        {
            var ctrl = new SpanTag<H5Tag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public SpanTag<H5Tag<ParentType>> Span(object value)
        {
            var ctrl = new SpanTag<H5Tag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public StrongTag<H5Tag<ParentType>> Strong()
        {
            var ctrl = new StrongTag<H5Tag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public H5Tag<ParentType> Strong(StrongTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public StrongTag<H5Tag<ParentType>> Strong(string text)
        {
            var ctrl = new StrongTag<H5Tag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public StrongTag<H5Tag<ParentType>> Strong(Control control)
        {
            var ctrl = new StrongTag<H5Tag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public StrongTag<H5Tag<ParentType>> Strong(object value)
        {
            var ctrl = new StrongTag<H5Tag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public SubTag<H5Tag<ParentType>> Sub()
        {
            var ctrl = new SubTag<H5Tag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public H5Tag<ParentType> Sub(SubTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SubTag<H5Tag<ParentType>> Sub(string text)
        {
            var ctrl = new SubTag<H5Tag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public SubTag<H5Tag<ParentType>> Sub(Control control)
        {
            var ctrl = new SubTag<H5Tag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public SubTag<H5Tag<ParentType>> Sub(object value)
        {
            var ctrl = new SubTag<H5Tag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        public SupTag<H5Tag<ParentType>> Sup()
        {
            var ctrl = new SupTag<H5Tag<ParentType>>(this);
            Controls.Add(ctrl);
            return ctrl;
        }

        public H5Tag<ParentType> Sup(SupTag child)
        {
            Controls.Add(child);
            return this;
        }
        
        public SupTag<H5Tag<ParentType>> Sup(string text)
        {
            var ctrl = new SupTag<H5Tag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(text);
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            
            return ctrl;
        }

        public SupTag<H5Tag<ParentType>> Sup(Control control)
        {
            var ctrl = new SupTag<H5Tag<ParentType>>(this);
            Controls.Add(ctrl);
            ctrl.Controls.Add(control);
            
            return ctrl;
        }

        public SupTag<H5Tag<ParentType>> Sup(object value)
        {
            var ctrl = new SupTag<H5Tag<ParentType>>(this);
            LiteralControl lc = new LiteralControl(SafeString(value));
            Controls.Add(ctrl);
            ctrl.Controls.Add(lc);
            return ctrl;
        }
        
        
        public H5Tag<ParentType> Text(string text)
        {
            Controls.Add(new LiteralControl(text));
            return this;
        }
        
        public H5Tag<ParentType> Text(object value)
        {
            Controls.Add(new LiteralControl(SafeString(value)));
            return this;
        }
        
        
    }
}